﻿using System;
using SortOf;

namespace ExampleGraphSearch
{
    class Program
    {
        static void Main(string[] args)
        {
            Graph depthGraph = new Graph();
            AddData(ref depthGraph);
            depthGraph.DepthFirstSearch();
            Console.WriteLine();

            Graph breathGraph = new Graph();
            AddData(ref breathGraph);
            breathGraph.BreadthFirstSearch();
            Console.WriteLine();


            ConsoleKeyInfo info = Console.ReadKey();
            while (info.Key != ConsoleKey.Enter)
                info = Console.ReadKey();
        }

        private static void AddData(ref Graph graph)
        {
            {
                graph.AddVertex("A");
                graph.AddVertex("B");
                graph.AddVertex("C");
                graph.AddVertex("D");
                graph.AddVertex("E");
                graph.AddVertex("F");
                graph.AddVertex("G");
                graph.AddVertex("H");
                graph.AddVertex("I");
                graph.AddVertex("J");
                graph.AddVertex("K");
                graph.AddVertex("L");
                graph.AddVertex("M");
                graph.AddVertex("N");
                graph.AddVertex("O");
                graph.AddVertex("P");
                graph.AddVertex("Q");
                graph.AddVertex("R");
                graph.AddVertex("S");
                graph.AddVertex("T");
            }
            {
                graph.AddEdge(0x00, 0x01);
                graph.AddEdge(0x00, 0x04);
                graph.AddEdge(0x00, 0x07);
                graph.AddEdge(0x00, 0x0A);
                graph.AddEdge(0x01, 0x02);
                graph.AddEdge(0x02, 0x03);
                graph.AddEdge(0x03, 0x02);
                graph.AddEdge(0x04, 0x05);
                graph.AddEdge(0x05, 0x06);
                graph.AddEdge(0x06, 0x05);
                graph.AddEdge(0x07, 0x08);
                graph.AddEdge(0x08, 0x09);
                graph.AddEdge(0x09, 0x08);
                graph.AddEdge(0x0A, 0x0B);
                graph.AddEdge(0x0B, 0x0C);
                graph.AddEdge(0x0C, 0x0D);
                graph.AddEdge(0x0D, 0x0E);
                graph.AddEdge(0x0E, 0x0F);
                graph.AddEdge(0x0F, 0x10);
                graph.AddEdge(0x10, 0x11);
                graph.AddEdge(0x11, 0x12);
                graph.AddEdge(0x12, 0x00);
            }
        }
    }
}
